<?php
/*=======================================================================
 Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
 =======================================================================*/
global $prefix, $db;

	$image_id = $_GET['image_id'];
	$row_image = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_upload WHERE id='".$image_id."'"));
	$imageowner = $row_image['username'];
	$config = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_upload_config"));
	$sql = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_upload WHERE id='".$image_id."'"));
	$image = $config['path'].$sql['img'];
	unlink($image);
	$db->sql_query("DELETE FROM ".$prefix."_upload WHERE id='".$image_id."'") or die(mysql_error());
	redirect("admin.php?op=Uploaduserdetail&amp;username=".$imageowner."");
 ?>